package fhp.hlhj.giantfold.presenter

import com.lzy.okgo.model.HttpParams
import fhp.hlhj.giantfold.interfaces.IBindPhone
import fhp.hlhj.giantfold.javaBean.BindPhoneBean
import fhp.hlhj.giantfold.javaBean.GetSmsBean
import fhp.hlhj.giantfold.module.BindPhoneModule

/**
 * author: FHP
 * data: on 2018\1\18 0018 9:50
 * E-Mail: 103945089@qq.com
 */
class BindPhonePresenter(val iBindPhone: IBindPhone) : BindPhoneModule.BingdPhoneListener {

    private val bindPhoneModule=BindPhoneModule()

    fun bindPhone(params: HttpParams){
        bindPhoneModule.bindPhone(params,this)
    }

    fun getSms(params: HttpParams){
        bindPhoneModule.getSms(params,this)
    }
    override fun onSmsListener(getSmsBean: GetSmsBean) {
        iBindPhone.getSmsCode(getSmsBean)
    }

    override fun showLoading() {
        iBindPhone.showLoading()
    }

    override fun onBindListener(bindPhoneBean: BindPhoneBean) {
        iBindPhone.bindPhone(bindPhoneBean)
    }
}